package com.hongpu.mapper;

import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hongpu.domain.MultiTenant;
import com.hongpu.dto.MultiTenantDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author Michael zhang
 * @description 针对表【multi_tenant(多租户管理)】的数据库操作Mapper
 * @createDate 2025-05-30 09:24:21
 * @Entity generator.domain.MultiTenant
 */
@Mapper
public interface MultiTenantMapper extends BaseMapper<MultiTenant> {
    /**
     * 更新多租户信息
     *
     * @param multiTenant
     * @return
     */
    @InterceptorIgnore(tenantLine = "true")
    public boolean updatedById(MultiTenant multiTenant);

    /**
     * 将租户状态设置为删除状态
     */
    @InterceptorIgnore(tenantLine = "true")
    public boolean updateStatusDeleted(@Param("tenantId") Long tenantId,@Param("updateBy") Long updateBy);

    /**
     * 将租户状态设置为暂停状态
     */
    @InterceptorIgnore(tenantLine = "true")
    public boolean updateStatusSuspended(@Param("tenantId") Long tenantId,@Param("updateBy") Long updateBy);
    /**
     * 将租户状态设置为启用状态
     */
    @InterceptorIgnore(tenantLine = "true")
    public boolean updateStatusActive(@Param("tenantId") Long tenantId,@Param("updateBy") Long updateBy);

    /**
     * 分页查询
     */
    @InterceptorIgnore(tenantLine = "true")
    public IPage<MultiTenant> selectPage(@Param("ipage") IPage ipage, @Param("multiTenantDto") MultiTenantDto multiTenantDto);

    /**
     * 所有租户集合
     */
    @InterceptorIgnore(tenantLine = "true")
    public List<MultiTenant> getAllTenant();

    /**
     * 租户详情
     */
    @InterceptorIgnore(tenantLine = "true")
    public MultiTenant detail(Long tenantId);

    /**
     * 根据租户ID查询用于URL或系统识别的唯一代码
     */
    @InterceptorIgnore(tenantLine = "true")
    public String getSlugByTenantId(Long tenantId);
}




